<?php
namespace home\model;
use framework\core\Model;

class LoginModel extends Model{
    protected $login_table= 'ask_user';
    //查询数据库有为有用户
    public function login($data){
        $sql="select * from $this->login_table where username='$data' or email='$data'";
        return $this->dao->fetchOne($sql);
    }
    //判断密码
    public function password($pass){
        $sql="select * from $this->login_table where password='$pass'";
        return $this->dao->fetchOne($sql);
    }
}